Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version of the OpenKlant2 client #1381

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

swrichards
Copy link
Contributor

No description provided.

@swrichards swrichards force-pushed the tasks/2735-openklant-api-client branch 12 times, most recently from ff17d65 to 01d0d7d Compare September 4, 2024 14:41
Copy link
Contributor

@pi-sigma pi-sigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question: why are we building the version into the package name? Is this provisional?

src/openklant2/_resources/base.py Outdated Show resolved Hide resolved
src/openklant2/_resources/partij.py Outdated Show resolved Hide resolved
return cast(PaginatedResponseBody[Partij], self.process_response(response))

def retrieve(
self, /, uuid: str | uuid.UUID, *, params: Optional[PartijRetrieveParams] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only method (at least in this class) where you explicitly mark positional-only arguments as such.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was by design: I wanted the path parameters to be positional only, to distinguish them from the other kind of parameters. The idea is that all path parameters would then appear in sequence as positional-only args.

src/openklant2/_resources/partij.py Outdated Show resolved Hide resolved
src/openklant2/tests/helpers.py Show resolved Hide resolved
src/openklant2/tests/helpers.py Outdated Show resolved Hide resolved
src/openklant2/tests/test_partij.py Outdated Show resolved Hide resolved


@pytest.fixture()
def an_organisatie(client):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

src/openklant2/tests/test_partij.py Outdated Show resolved Hide resolved
rekeningnummers: Required[list[ForeignKeyRef] | None]
voorkeursRekeningnummer: Required[ForeignKeyRef | None]

voorkeurstaal: LanguageCode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the distinction between Required and NotRequired is exhaustive, but this is neither (same for the attributes below)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need Required mainly when we want to indicate "The key should be present, but it can be optionally None", as above for e.g. voorkeursRekeningnummer. If the field is required and not a union, no explicit Required is needed I believe.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 76.68394% with 135 lines in your changes missing coverage. Please review.

Project coverage is 94.96%. Comparing base (af6f72b) to head (2a3881d).

Files with missing lines Patch % Lines
src/openklant2/_resources/base.py 35.93% 41 Missing ⚠️
src/openklant2/tests/test_partij.py 50.00% 28 Missing ⚠️
src/openklant2/exceptions.py 64.70% 18 Missing ⚠️
src/openklant2/tests/test_digitaal_adres.py 62.06% 11 Missing ⚠️
src/openklant2/tests/test_partij_identificator.py 59.25% 11 Missing ⚠️
src/openklant2/_resources/partij.py 62.50% 9 Missing ⚠️
src/openklant2/_resources/digitaal_adres.py 66.66% 6 Missing ⚠️
src/openklant2/_resources/partij_identificator.py 66.66% 6 Missing ⚠️
src/openklant2/client.py 66.66% 4 Missing ⚠️
src/openklant2/factories/helpers.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1381      +/-   ##
===========================================
- Coverage    95.25%   94.96%   -0.29%     
===========================================
  Files         1008     1032      +24     
  Lines        37370    37949     +579     
===========================================
+ Hits         35595    36039     +444     
- Misses        1775     1910     +135     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@swrichards swrichards force-pushed the tasks/2735-openklant-api-client branch from 01d0d7d to 78de82f Compare September 5, 2024 09:47
@swrichards
Copy link
Contributor Author

General question: why are we building the version into the package name? Is this provisional?

The thinking here is that we already have an'openklant client, and generally that OpenKlant 2 is not simply a continuation of <2, but effectively an entirely different API. But we can check with @alextreme if he agrees with the naming strategy.

@swrichards swrichards force-pushed the tasks/2735-openklant-api-client branch 2 times, most recently from 95851e1 to 8b23d82 Compare September 5, 2024 10:43
@swrichards swrichards marked this pull request as ready for review September 5, 2024 10:47
@swrichards swrichards marked this pull request as draft September 5, 2024 12:27
@swrichards
Copy link
Contributor Author

Leaving this in draft for the moment: I have moved on to the implementation and am finding some missing params in the Partij resource, I'll add them to this PR.

@swrichards swrichards force-pushed the tasks/2735-openklant-api-client branch from 8b23d82 to e589b57 Compare September 12, 2024 12:32
@swrichards swrichards marked this pull request as ready for review September 12, 2024 12:51
@swrichards
Copy link
Contributor Author

Leaving this in draft for the moment: I have moved on to the implementation and am finding some missing params in the Partij resource, I'll add them to this PR.

@pi-sigma Some more changes prompted by #1396 (which will follow this PR).

Copy link
Contributor

@pi-sigma pi-sigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple minor suggestions

src/openklant2/exceptions.py Outdated Show resolved Hide resolved
src/openklant2/tests/helpers.py Outdated Show resolved Hide resolved
src/openklant2/tests/helpers.py Outdated Show resolved Hide resolved
src/openklant2/tests/test_partij.py Outdated Show resolved Hide resolved
src/openklant2/tests/test_partij_identificator.py Outdated Show resolved Hide resolved
@alextreme alextreme merged commit 4bc9462 into develop Sep 12, 2024
22 checks passed
@alextreme alextreme deleted the tasks/2735-openklant-api-client branch September 12, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants